package com.tyylab.kestrel.framework.example.impl.biz;

import com.tyylab.kestrel.framework.example.api.IHellowWorldApi;
import com.tyylab.kestrel.framework.util.ContextUtil;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class HellowWorldApiImpl implements IHellowWorldApi {
    @Override
    public String sayHi(String name, int age) {
        System.out.println("Hello " + name + " " + age);
        return name + " " + age;
    }

    @Override
    public Object sayHi2(String name, int age) {
        Map<String, Object> map = new HashMap<>();
        map.put("name", name);
        map.put("age", age);
        map.put("tenantId", ContextUtil.getTenantId());
        return map;
    }

    @Override
    public String sayHi3(List<String> name, int age) {
        return "hello3";
    }
}
